package com.mszlu.blog.controller;

import com.mszlu.blog.service.LoginService;
import com.mszlu.blog.service.SysUserService;
import com.mszlu.blog.vo.Result;
import com.mszlu.blog.vo.params.LoginParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;



/**
 * @author linKe
 * 登录控制器
 */
@Api(value="登录",tags = "loginApi")
@RestController
@RequestMapping("login")
public class LoginController {
    /**
     * 建一个loginService 专门负责登录
     */
    @Resource
    private LoginService loginService;


    @ApiOperation(value = "登录验证",notes = "传入登录参数vo类")
    @PostMapping
    public Result login(@RequestBody LoginParam loginParam){
        //登录 验证用户  访问用户表，但是   不是userService表所负责的
        return loginService.login(loginParam);
    }
}
